'use client';

import { useState } from 'react';
import AgentList from '../components/AgentList';
import AgentForm from '../components/AgentForm';

export default function AgentPage() {
  const [showAgentForm, setShowAgentForm] = useState(false);

  const handleCreateAgent = () => {
    setShowAgentForm(true);
  };

  const handleBackToList = () => {
    setShowAgentForm(false);
  };

  if (showAgentForm) {
    return <AgentForm onBack={handleBackToList} />;
  }

  return <AgentList onCreateNew={handleCreateAgent} />;
} 